﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ingenious.Graph;

namespace Ingenious.Core
{
    /// <summary>
    /// Contains the minimal information required to resolve a property from the graph store
    /// </summary>
    /// <typeparam name="TTripleId"></typeparam>
    public class NodePropertyInfo<TTripleId>
    {
        public NodePropertyInfo()
        {
            // TODO: Set this via a predicate scope parameter
            LanguageTag = "en";
        }

        private readonly object m_syncObject = new object();

        public TTripleId ID { get; set; }
        public object SyncObject { get { return m_syncObject; } }
        public bool IsBlocking { get; set; }
        public NamespaceUri NamespaceUri { get; set; }
        public ItemWrappingInfo ItemWrappingInfo { get; set; }

        // Literal values are not delay-loaded in Ingenious Framework
        public string LanguageTag { get; set; }
        public object LiteralValue { get; set; }

        public string LiteralTypeString
        {
            get
            {
                return LiteralValue != null ? LiteralValue.GetType().ToString() : null;
            }
        }

        public object Value { get; set; }
    }
}
